package org.shreker.shan.core.domain;

import java.math.BigDecimal;
import org.shreker.shan.base.domain.BaseBean;
import org.shreker.shan.core.util.Constant;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Account extends BaseBean {
	
	/**
	 * 交易密码
	 */
	private String tradePassword;
	/**
	 * 可用金额
	 */
	private BigDecimal usableAmount;
	/**
	 * 冻结金额
	 */
	private BigDecimal freezedAmount;
	/**
	 * 待收利息
	 */
	private BigDecimal unReceiveInterest;
	/**
	 * 待收本金
	 */
	private BigDecimal unReceivePrincipal;
	/**
	 * 待还本息
	 */
	private BigDecimal unReturnAmount;
	/**
	 * 剩余额度
	 */
	private BigDecimal remainLimit;
	/**
	 * 授信额度
	 */
	private BigDecimal borrowLimit;
	
	public void initAccount() {
		usableAmount = Constant.DECIMAL_ZERO;
		freezedAmount = Constant.DECIMAL_ZERO;
		unReceiveInterest = Constant.DECIMAL_ZERO;
		unReceivePrincipal = Constant.DECIMAL_ZERO;
		unReturnAmount = Constant.DECIMAL_ZERO;
		remainLimit = Constant.DECIMAL_ZERO;    
		borrowLimit = Constant.DECIMAL_ZERO;
	}
	
	public BigDecimal getTotalAmount() {
		return usableAmount.add(freezedAmount).add(unReceivePrincipal);
	}

}
